home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbasicpg.zip / NEWNAME.BAS < prev    next >
BASIC Source File  |  1989-08-31  |  738b  |  25 lines

  1. ' NEWNAME.BAS
  2. ' This program lets you rename a data file in the current directory.
  3.  
  4. CLS
  5.  
  6. PRINT "The current directory contains the following files:"
  7. PRINT
  8.  
  9. FILES "*.*"                ' display files in current directory
  10.  
  11. PRINT                      ' get old and new filenames
  12. INPUT "Which file would you like to rename?  ", oldName$
  13. INPUT "What would you like the new name to be?  ", newName$
  14.  
  15. NAME oldName$ AS newName$  ' try to rename file
  16.  
  17. ' if oldName$ does not exist or newName$ is an invalid name, the
  18. '   NAME statement will generate a run-time error; otherwise, the
  19. '   following lines will be executed:
  20.  
  21. PRINT                      ' print success message
  22. PRINT UCASE$(oldName$); " renamed successfully"
  23.  
  24.  
  25.